package com.example.demo.controller;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class AopLogController {
    @GetMapping("/aoptest")
    public String aVoid(Model model){

        //步骤1
        //步骤2
        System.out.println("执行了aoptest");
        int i = 10/0;
        //步骤3
//        我需要处理上面这个异常


        return "hello aop test";
    }
    @GetMapping("/aoptest2")
    public String aVoid2(Model model){


        //步骤1

        //步骤2
        System.out.println("执行了aoptest2");
        //步骤3
        int i = 10/0;
//        我又要处理一遍异常


        return "hello aop test2";
    }

    @GetMapping("/aopbbb2")
    public String bbb2(Model model){

        //步骤1

        //步骤2
        System.out.println("执行了bbb2");
        //步骤3


        return "hello aop bbb2";
    }
}
